//补0函数
export let zeronum = (num) => (num < 10 ? "0" + num : num);

//区间日期YYYY-MM-DD HH:MM:SS 函数
export let getYYYYMMDDHHMMSS = (time) => {
    let d = new Date (time)
        return d.getFullYear() + '-' + zeronum(d.getMonth() + 1) + '-' + zeronum(d.getDate()) + ' ' +
        zeronum(d.getHours()) + ':' + zeronum(d.getMinutes()) + ':' + zeronum(d.getSeconds())
};

//区间日期 HH:MM:SS 函数
export let HHMMSS = (time) => {
    let d = new Date (time)
        return  zeronum(d.getHours()) + ':' + zeronum(d.getMinutes()) + ':' + zeronum(d.getSeconds())
};

//区间日期 HH 函数
export let HH = (time) => {
    let d = new Date (time)
        return  zeronum(d.getHours())
};

//axios
import axios from 'axios'
axios.defaults.baseURL = 'http://127.0.0.1:5000'

export default axios
